{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import requests\n",
    "from bs4 import BeautifulSoup\n",
    "request = requests.get('http://www.duokan.com/u/mybook')\n",
    "request.encoding = 'utf-8'\n",
    "#print(request.text)\n",
    "#soup = BeautifulSoup(request.text)\n",
    "#soup = BeautifulSoup(request.text, 'html5lib')\n",
    "soup = BeautifulSoup(request.text, 'html.parser')\n",
    "#print(soup.prettify())\n",
    "#print(soup.text)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[]\n[]\n"
     ]
    }
   ],
   "source": [
    "for books in soup.select('.u-bookitm1'):\n",
    "    print(books.select('li'))\n",
    "    lis = books.select('li')\n",
    "    for li in lis:\n",
    "        print(li.text)\n",
    "    #title = books.select('.title')[0].text\n",
    "    #print(books.select('a'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    ""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
